import { handleRequest } from './index';
import request2 from '@/utils/request2';
import { safetyApiUrl } from '@/api/config'


// 获取-机械设备列表
export function getEquipmentManagemenList(data) {
    return handleRequest({
        url: '/equipment/list',
        method: 'post',
        data
    })
}
// 获取-物资设备列表
export function getMaterialList(data) {
    return request2({
        url: safetyApiUrl + '/equipment/findListByMain',
        method: 'post',
        data
    })
}
// 新增-机械设备维修保养
export function addMaintenance(data) {
    return handleRequest({
        url: '/equipment-maintenance',
        method: 'post',
        data
    })
}

// 新增-机械设备
export function addEquipment(data) {
    return handleRequest({
        url: '/equipment',
        method: 'post',
        data
    })
}

// 修改-机械设备
export function updateEquipment(data) {
    return handleRequest({
        url: '/equipment/update',
        method: 'post',
        data
    })
}

// 删除-机械设备
export function deleteEquipment(params) {
    return handleRequest({
        url: '/equipment/del',
        method: 'post',
        params
    })
}
// 查看-机械设备详情
export function getEquipmentDetail(params) {
    return handleRequest({
        url: '/equipment',
        method: 'get',
        params
    })
}